﻿<form onsubmit="return false;">
    <div class="row">
        <div class="large-6 columns">
            <label for="email">Login: </label>
        </div>
        <div class="large-6 columns">
            <input id="email" type="text" data-bind="enterPressed: submit, value: email" />
        </div>
    </div>
    <div class="row">
        <a class="button" data-bind="click: submit">Sign In</a>
    </div>
</form>

<script type="text/javascript">

    var model = (function () {

        var email = ko.observable('');

        function submit() {
            window.localStorage.setItem('account', email());
            window.location.href = '../../';
        }

        return {
            submit: submit,
            email: email,
            context: {
                cart: function () {
                    return {
                        items: function () {
                            return {
                                length: 0
                            };
                        }
                    };
                }
            }
        };
    })();

    ko.applyBindings(model);
</script>
